package game.logic;

import game.screen.AbsScreen;
import game.screen.ScreenGameLost;
import game.screen.ScreenMenu;
import game.screen.ScreenPlaying;
import game.screen.ScreenSelectLevel;
import game.shared.Resources;

import com.badlogic.gdx.Game;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Screen;
import com.badlogic.gdx.graphics.GL10;

public class GameControl extends Game {

	int nScreen = 4;
	AbsScreen[] screens;
	int curScreen;
	
	@Override
	public void create() {	
		screens = new AbsScreen[nScreen];
		screens[0] = new ScreenMenu(this);
		screens[1] = new ScreenPlaying(this);
		screens[2] = new ScreenSelectLevel(this);
		screens[3] = null;
		
		setScreen(screens[0]);
	}

	@Override
	public void render() 
	{
		screens[curScreen].update();
		Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
		screens[curScreen].render(1);
	}
	
	@Override
	public void resize(int width, int height) {
		super.resize(width, height);
	}
	
	@Override
	public void resume() {
		super.resume();
	}
	
	public void setScreen(int index) {
		curScreen = index;
		super.setScreen(screens[index]);
	}
	
	public GameControl() {
	}
	
}
